package com.woniuxy.java106crm.config;

import com.woniuxy.java106crm.interceptor.ControllerInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @create 2024-04-19 10:46
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Resource
    private ControllerInterceptor controllerInterceptor;

    // 注册拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(controllerInterceptor).addPathPatterns("/**");
    }
}